#!/bin/sh
K8S_SERVER_BIN_DIR=/opt/soft/kubernetes/server/bin/
MASTER_CERT_DIR=/opt/cert
MASTER_CONFIG_DIR=/opt/kubeconfig

NODE_BIN_DIR=/opt/k8s/bin/
NODE_CONFIG_DIR=/etc/kubernetes
NODE_CERT_DIR=${NODE_CONFIG_DIR}/cert/
NODE_KUBELET_SYSTEMD=kubelet.service.template.1

node_ip=172.16.0.234

scp ${K8S_SERVER_BIN_DIR}/{kubelet,kube-proxy} root@${node_ip}:${NODE_BIN_DIR}

echo "Copying certificates"
scp ${MASTER_CERT_DIR}/{ca.pem,kubelet*.pem} root@${node_ip}:${NODE_CERT_DIR}

echo "Copying kubelet-bootstrap config files"
scp ${MASTER_CONFIG_DIR}/kubelet-bootstrap.kubeconfig root@${node_ip}:${NODE_CONFIG_DIR}
scp kubelet-config.yaml root@${node_ip}:${NODE_CONFIG_DIR}
scp ${NODE_KUBELET_SYSTEMD} root@${node_ip}:/etc/systemd/system/kubelet.service

